package com.project.service;

import com.project.dao.IUserDao;
import com.project.dao.impl.UserDaoImpl;
import com.project.server.Request;
import com.project.server.Response;
import com.project.server.Servlet;
import com.project.util.DaoFactory;
import com.project.util.WebServlet;

/**
 * 删除用户组件
 */
@WebServlet("del")
public class DelService implements Servlet {
    private IUserDao dao = (IUserDao)DaoFactory.getDao("IUserDao");
    public void service(Request req, Response resp){
        //得到客户端提交的ID
        int id =Integer.parseInt(req.getParameter("id"));
        //调用持久方法，完成删除
        dao.del(id);
        FindAllService find = new FindAllService();
        find.service(req,resp);
    }
}
